<table class="table table-bordered table-hover table-striped">
	<tbody>
		<tr align="center">
			<td><strong>编号</strong></td>
			<td><strong>楼层</strong></td>
			<td><strong>房间号</strong></td>
			<td><strong>户型</strong></td>
			<td><strong>出租类型</strong></td>
			<td><strong>月租金</strong></td>
			<td><strong>月物业费</strong></td>
			<td><strong>押金</strong></td>
			<td><strong>办理时间</strong></td>
			<td><strong>操作</strong></td>
		</tr>
		<?php if($list){ foreach($list as $k=>$ls){ ?>
		<tr align="center">
			<td><?php echo ($page-1)*C('PAGE_SIZE')+($k+1); ?></td>
			<td>{$ls['room_number']}</td>
			<td>{$ls['floor']}</td>
			<td>{$ls['root_type']}</td>
			<td>{$ls['rent_type']}</td>
			<td>{$ls['rent']}</td>
			<td>{$ls['property']}</td>
			<td>{$ls['deposit']}</td>
			<td><?php echo date('Y-m-d H:i', $ls['createtime']); ?></td>
			<td>
				<a title="编辑" href="javascript:;" onclick="admin_role_edit('房间编辑','index.html?room_id={$ls['room_id']}','1')" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> 
				<a title="删除" href="javascript:;" onclick="admin_role_del(this,'{$ls['room_id']}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
			</td>
		</tr>
		<?php } }else{ ?>
		<tr align="center">
			<td colspan="14">暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<div class="pagination" style="float: right; widht: 95%">
	<include file="Common/page" />
</div>
<script>
	$(document).ready(function(){
		$("a.delete").on('click', function(){
			if (confirm("确认删除？") == true){
				var obj = $(this);
				var room_id = obj.attr('room_id');
				$.post("remove.html",{id: room_id}, function(data){
					if(data/1){
						alert('删除成功');
						obj.parent('td').parent('tr').remove();
					}else{
						alert('删除失败');
					}
				});
			}
		});
		
		$(".icon-edit").on('click', function(){
			$.get('index.html', {room_id: $(this).attr('room_id')}, function(data){
				if(data.errCode/1){
					$("#room_number").val(data.info.room_number);
					$("#room_id").val(data.info.room_id);
					$("#rent").val(data.info.rent);
					$("#property").val(data.info.property);
					$("#deposit").val(data.info.deposit);
				}
			},"JSON");
		});
	});
</script>